FROM perl:5.32 AS builder

RUN apt-get update && apt-get install -y \
        git \
        curl \
        python-pip \
        && pip install s3cmd \
        && cpanm --quiet --notest \
            utf8~"== 1.24" \
            Time::HiRes~"== 1.9764" \
            uni::perl~"== 0.91" \
            English~"== 1.11" \
            Encode~"== 3.10" \
            File::Basename~"== 2.85" \
            File::Path~"== 2.18" \
            POSIX JSON~"== 4.03" \
            YAML::XS~"== 0.83" \
            LWP::UserAgent~"== 6.54" \
            HTTP::Headers~"== 6.32" \
        && rm -rf \
                /root/.cpanm \
                /root/.cache \
                /var/lib/apt/lists/*

FROM builder AS MyScripts

WORKDIR /usr/src/app
COPY . /usr/src/app

#CMD [ "perl", "./your-daemon-or-script.pl" ]
